package com.seata.core.utils;

import com.google.common.collect.HashBasedTable;
import com.google.common.collect.Table;

/**
 * @author 蚂蚁会花呗
 * @date 2021/9/28 16:14
 * 幂等性
 */
public class IdempotentUtils {
    private static Table<Class<?>,String,String> map = HashBasedTable.create();

    public static void addMarker(Class<?> clazz,String xid,String marker){
        map.put(clazz,xid,marker);
    }

    public static String getMarker(Class<?> clazz,String xid){
        return map.get(clazz,xid);
    }

    public static void removeMarker(Class<?> clazz,String xid){
        map.remove(clazz,xid);
    }
}
